<template>
  <view
    class="al-c gap-1 fz-14"
    :class="{
      'hover-1': arrow || copy,
    }"
    @click="onClick"
  >
    <span class="op-5 fz-13 shrink-0">{{ label }}</span>

    <view class="ml-auto ta-r">
      <slot>{{ value }}</slot>
    </view>
    <u-icon name="arrow-right" size="12px" v-if="arrow"></u-icon>
  </view>
</template>

<script>
export default {
  props: {
    label: String,
    value: String,
    arrow: Boolean,
    copy: Boolean,
  },
  methods: {
    onClick() {
      if (this.copy && this.value) {
        uni.$h.setClipboard(this.value);
      }
    },
  },
};
</script>
